#include "litteriem.h"
#include "ui_litteriem.h"

#include <QPixmap>
#include "chatform.h"
#include <QMessageBox>
#include <QDebug>
#include <QMouseEvent>

LitterIem::LitterIem(QString picPath, QWidget *parent) :
    QWidget(parent),
    ui(new Ui::LitterIem)
{
    ui->setupUi(this);

    QPixmap p(picPath);
    ui->label_pic->setPixmap(p);
    //关闭
    //connect(ui->pushButton_close,SIGNAL(clicked()),this,SLOT(doClose()));
    //

    //connect(ui->label_pic,SIGNAL(clicked()),this,SLOT(doChat()));
}

LitterIem::~LitterIem()
{
    delete ui;
}
void LitterIem::displayNickname(QString nickname)
{
    ui->label_name->setText(nickname);
}
void LitterIem::displayMood(QString mood)
{
    ui->label_signal->setText(mood);
}

void LitterIem::setUUID(QString uuid)
{
    m_UUID=uuid;
}
bool LitterIem::isUUID(QString uuid)
{
    return (m_UUID==uuid) ? true:false;
}
void LitterIem::setFd(int fd)
{
    m_fd=fd;
}



void LitterIem::mousePressEvent(QMouseEvent *event)
{

    if(event->button()== Qt::LeftButton)
        {
         emit sigTalkWindow(m_fd,m_UUID);
           // QMessageBox::information(NULL,"单击","单击了我",
           //                          QMessageBox::Yes|QMessageBox::No,QMessageBox::Yes);
        }

}

